home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol C-14 / Vol C-14.iso / games / sheepsho.swf / scripts / frame_246 / DoAction_2.as next >
Text File  |  2012-04-23  |  2KB  |  74 lines

  1. if(sheephold == 1)
  2. {
  3.    setProperty("/bandl", _visible, 1);
  4.    setProperty("/bandr", _visible, 1);
  5. }
  6. mx = _xmouse - 20;
  7. my = _ymouse;
  8. distx = mx - oldmx1;
  9. disty = my - oldmy1;
  10. Radtodeg = 57.29577951308232;
  11. if(distx == 0 and my < 0)
  12. {
  13.    angle = 270;
  14. }
  15. else if(distx == 0 and disty > 0)
  16. {
  17.    angle = 90;
  18. }
  19. else if(distx > 0 and disty >= 0)
  20. {
  21.    angle = Math.atan(disty / distx) * Radtodeg;
  22. }
  23. else if(distx < 0 and disty > 0)
  24. {
  25.    angle = 180 - Math.atan(disty / Math.abs(distx)) * Radtodeg;
  26. }
  27. else if(distx < 0 and disty <= 0)
  28. {
  29.    angle = 180 + Math.atan(disty / distx) * Radtodeg;
  30. }
  31. else if(distx > 0 and disty < 0)
  32. {
  33.    angle = 360 - Math.atan(Math.abs(disty) / distx) * Radtodeg;
  34. }
  35. length = Math.sqrt(distx * distx + disty * disty);
  36. setProperty("/bandl", _xscale, length * 100);
  37. setProperty("/bandl", _rotation, angle);
  38. setProperty("/bandl", _X, oldmx1);
  39. setProperty("/bandl", _Y, oldmy1);
  40. mx = _xmouse + 20;
  41. my = _ymouse;
  42. distx = mx - oldmx2;
  43. disty = my - oldmy2;
  44. Radtodeg = 57.29577951308232;
  45. if(distx == 0 and my < 0)
  46. {
  47.    angle = 270;
  48. }
  49. else if(distx == 0 and disty > 0)
  50. {
  51.    angle = 90;
  52. }
  53. else if(distx > 0 and disty >= 0)
  54. {
  55.    angle = Math.atan(disty / distx) * Radtodeg;
  56. }
  57. else if(distx < 0 and disty > 0)
  58. {
  59.    angle = 180 - Math.atan(disty / Math.abs(distx)) * Radtodeg;
  60. }
  61. else if(distx < 0 and disty <= 0)
  62. {
  63.    angle = 180 + Math.atan(disty / distx) * Radtodeg;
  64. }
  65. else if(distx > 0 and disty < 0)
  66. {
  67.    angle = 360 - Math.atan(Math.abs(disty) / distx) * Radtodeg;
  68. }
  69. length = Math.sqrt(distx * distx + disty * disty);
  70. setProperty("/bandr", _xscale, length * 100);
  71. setProperty("/bandr", _rotation, angle);
  72. setProperty("/bandr", _X, oldmx2);
  73. setProperty("/bandr", _Y, oldmy2);
  74.